<%--
  用户编辑页面
  User: wangyanginfo
  Date: 12-9-13
  Time: 下午3:14
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ include file="/common/tag/taglibs.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="easyui-layout" data-options="fit:true">
    <form id="userItemForm" method="post">
        <div data-options="region:'center',border:false" style="padding:5px;background:#fff;border:1px solid #ccc;">
            <table class="doc-table">
                <tbody>
                <tr>
                    <th width="15%"></th>
                    <th width="35%"></th>
                    <th width="15%"></th>
                    <th width="35%"></th>
                </tr>
                <tr>
                    <td class="labelTd">登录名：</td>
                    <td>
                        <input type="hidden" id="userUserId" name="user.userId"
                               value="<c:out value="${user.userId}" />"/>
                        <input type="text" id="userLoginId" name="user.loginId" value="<c:out value="${user.loginId}" />"
                               class="easyui-validatebox inputTextClass"
                               validType="login"
                               required="true" />
                    </td>
                    <td class="labelTd">姓名：</td>
                    <td>
                        <input type="text" id="userName" name="user.name" value="<c:out value="${user.name}" />"
                               class="easyui-validatebox inputTextClass"
                               validType="name"
                               required="true" />
                    </td>
                </tr>
                <tr>
                    <td class="labelTd">性别：</td>
                    <td>
                        <input class="easyui-combobox" id="userGender" name="user.gender"
                               url="<c:url value="/system/queryComboboxByDict.do?param=GENDER_TYPE&selected=${user.gender}"/>"
                               valueField="id"
                               textFileld="text"
                               panelHeight="auto"
                               required="true"
                               editable="false"
                               missingMessage="请选择性别！"
                               />
                    </td>
                    <td class="labelTd">生日：</td>
                    <td>
                        <input id="userBirthday" name="user.birthday" class="easyui-datebox"
                               required="true"
                               editable="false"
                               missingMessage="生日不能为空！"
                               value="<c:out value="${user.birthday}" />"/>
                    </td>
                </tr>
                <tr>
                    <td class="labelTd">机构：</td>
                    <td>
                        <input class="easyui-combobox" id="userDeptId" name="user.deptId"
                               required="true"
                               editable="false"
                               data-options="url:'<c:url value="/system/queryComboboxByDept.do?selected=${user.deptId}"/>',
                               valueField:'id', textField:'text', panelHeight:'auto'"/>
                    </td>
                    <td class="labelTd">职位：</td>
                    <td>
                        <!-- editable="false" 不能输入，只能选择 -->
                        <input class="easyui-combobox" id="userJob" name="user.job"
                               required="true"
                               editable="false"
                               data-options="url:'<c:url value="/system/queryComboboxByDict.do?param=JOB_TYPE&selected=${user.job}"/>',
                               valueField:'id', textField:'text', panelHeight:'auto'"/>
                    </td>

                </tr>
                <tr>
                    <td class="labelTd">手机：</td>
                    <td>
                        <input type="text" id="userMobile" name="user.mobile" class="easyui-validatebox inputTextClass"
                               validType="mobile"
                               value="<c:out value="${user.mobile}" />"/>
                    </td>
                    <td class="labelTd">电话：</td>
                    <td>
                        <input type="text" id="userTel" name="user.tel" class="inputTextClass"
                               value="<c:out value="${user.tel}" />"/>
                    </td>
                </tr>
                <tr>
                    <td class="labelTd">邮箱：</td>
                    <td colspan="3">
                        <input type="text" id="userEmail" name="user.email" class="easyui-validatebox inputTextClass"
                               required="true"
                               validType="email"
                               value="<c:out value="${user.email}" />"/>
                    </td>
                </tr>
                <tr>
                    <td class="labelTd">默认角色：</td>
                    <td>
                        <input class="easyui-combobox" id="userRole" name="user.roleId"
                               editable="false"
                               data-options="url:'<c:url value="/system/queryComboboxByRole.do?param=${user.userId}&selected=${user.roleId}"/>',
                               valueField:'id', textField:'text', panelHeight:'auto'"/>
                    </td>
                    <td class="labelTd">有效性：</td>
                    <td>
                        <input class="easyui-combobox" id="userEnabled" name="user.enabled"
                               required="true"
                               editable="false"
                               data-options="url:'<c:url value="/system/queryComboboxByDict.do?param=IS_VALIDITY&selected=${user.enabled}"/>',
                               valueField:'id', textField:'text', panelHeight:'auto'"/>
                    </td>
                </tr>
                <tr>
                    <td class="labelTd">地址：</td>
                    <td colspan="3">
                        <input type="text" id="userAddress" name="user.address" class="inputTextClass"
                               style="width: 415px;" value="<c:out value="${user.address}" />"/>
                    </td>
                </tr>
                <tr>
                    <td class="labelTd" style="height: 113px;vertical-align: top;">备注：</td>
                    <td colspan="3" style="vertical-align: top;">
                        <textarea id="userDescription" name="user.description"
                                  style="width: 415px;height: 110px;"><c:out value="${user.description}"
                                                                             escapeXml="false"/></textarea>
                    </td>
                </tr>
                </tbody>
            </table>
        </div>
        <div data-options="region:'south',border:false" style="text-align:right;padding:5px 0;">
            <c:choose>
                <c:when test="${user != null}">
                    <c:set var="maker" value="update"/>
                </c:when>
                <c:otherwise>
                    <c:set var="maker" value="insert"/>
                </c:otherwise>
            </c:choose>
            <a class="easyui-linkbutton" data-options="iconCls:'icon-ok'" style="margin-right: 15px;"
               href="javascript:void(0)" onclick="doSubmit('<c:out value="${maker}" />');">保存</a>
            <a class="easyui-linkbutton" data-options="iconCls:'icon-cancel'" style="margin-right: 15px;"
               href="javascript:void(0)" onclick="doCancel();">取消</a>
        </div>
    </form>
</div>
</body>
</html>